FIX: Bonus Chests spawn again when loading back in. #982#992
Open
eh-K wants to merge 2 commits intosmartcmd:mainfrom
Open
FIX: Bonus Chests spawn again when loading back in. #982#992eh-K wants to merge 2 commits intosmartcmd:mainfrom
eh-K wants to merge 2 commits intosmartcmd:mainfrom
Conversation
… it. Fixes smartcmd#982 Added a check for if the world is new. Meaning no more additional chests if the world is loaded up again.
Collaborator
|
@eh-K please use |
Contributor
Author
Corrected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bonus Chests will infinitely spawn in upon each time loading in after saving.
Normally, bonus chests should only spawn upon loading a new world.
This PR fixes that.
Changes
Added a check for if the world is new, if so, spawn the bonus chest.
Previous Behavior
No matter how many times you spawn into a world after saving it, another bonus chest would spawn in.
Root Cause
There are no checks in BonusChestFeature.cpp so they will spawn every time upon loading.
New Behavior
Now the bonus chest will only spawn upon loading a new world.
Fix Implementation
Moved the entire bonus chest spawn logic into a nested check.
The check is IF the world is new. If new, then proceed to start the bonus chest spawn logic.
If the world has been saved and you load back in, the spawn logic is completely skipped.
AI Use Disclosure
No AI.
Related Issues